﻿<%@ Page Title="Search Passenger" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="SearchPax.aspx.cs" Inherits="IFD2.SearchPax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline">
    <%--<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>--%>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="ID Number: " meta:resourcekey="IdNo"></asp:Label>
                <asp:TextBox ID="txtIdNo" runat="server" MaxLength="20" CssClass="form-control input-sm" Width="100%"></asp:TextBox>
                <div onclick="refresh_img();">
                    <img id="img_chk" src="img_chk.ashx" />
                </div>
                <asp:TextBox ID="txtCheckCode" MaxLength="6" runat="server" CssClass="form-control input-sm" Width="100%"></asp:TextBox>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:Button ID="btnSearchTkt" runat="server" onclick="btnSearchTkt_Click" Text="Search in tickets" meta:resourcekey="SearchInTickets" CssClass="btn btn-sm btn-primary" Width="100%" />
            <asp:Button ID="btnSearchOrder" runat="server" Text="Search in orders" onclick="btnSearchOrder_Click" meta:resourcekey="SearchInOrders" CssClass="btn btn-sm btn-primary" Width="100%" />
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
            <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" style="min-width:800px;width:100%;" class="table-hover"
                            CellPadding="4" DataKeyNames="bk_id" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField HeaderText="tkt_no" SortExpression="tkt_no" meta:resourcekey="tkt_order_no">
                                    <ItemTemplate>
                                        <%# Convert.ToInt16(Eval("pax_sn")) > 0 ? "<a href='Ticket.aspx?tkt_no=" + (Convert.ToInt64(Eval("bk_id")) * 1000 + Convert.ToInt64(Eval("pax_sn"))).ToString() + "'>" : "<a href='Order.aspx?pnr=" + Eval("bk_id").ToString() + "'>" %>
                                        <%# Convert.ToInt16(Eval("pax_sn")) > 0 ? (Convert.ToInt64(Eval("bk_id")) * 1000 + Convert.ToInt16(Eval("pax_sn"))).ToString() : Convert.ToInt64(Eval("bk_id")).ToString() %></a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="family_name" HeaderText="family_name" SortExpression="family_name" meta:resourcekey="family_name" />
                                <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" meta:resourcekey="name" />
                                <asp:BoundField DataField="family_name_en" HeaderText="family_name_en" SortExpression="family_name_en" meta:resourcekey="family_name_en" />
                                <asp:BoundField DataField="name_en" HeaderText="name_en" SortExpression="name_en" meta:resourcekey="name_en" />
                                <asp:BoundField DataField="ori_airport" HeaderText="ori_airport" SortExpression="ori_airport" meta:resourcekey="ori_airport" />
                                <asp:BoundField DataField="des_airport" HeaderText="des_airport" SortExpression="des_airport" meta:resourcekey="des_airport" />
                                <asp:BoundField DataField="flt_date" HeaderText="flt_date" SortExpression="flt_date" meta:resourcekey="flt_date" DataFormatString="{0:yyyy-M-d}" />
                                <asp:TemplateField HeaderText="market_flt" SortExpression="market_flt" meta:resourcekey="market_flt">
                                    <ItemTemplate>
                                        <%# Eval("airline").ToString()+ Eval("flt_no").ToString()%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="operating_flt" SortExpression="operating_flt" meta:resourcekey="operating_flt">
                                    <ItemTemplate>
                                        <%# Eval("op_airline").ToString() + Eval("op_flt_no").ToString()%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>

                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                            SelectCommand="bll_tkt_search_pax" SelectCommandType="StoredProcedure">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="txtIdNo" Name="id_no" PropertyName="Text" Type="String" />
                                <asp:ControlParameter ControlID="hidType" Name="search_type" PropertyName="Value" Type="String" />
                                <asp:SessionParameter Name="user_airline" SessionField="AIRLINE" Type="String" />
                                <asp:SessionParameter DefaultValue="" Name="user_office" SessionField="OFFICE" Type="String" />
                                <asp:SessionParameter DefaultValue="" Name="office_type" SessionField="OFFICE_TYPE" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <asp:HiddenField ID="hidType" runat="server" />
                    </div>

                </div>
            </div>
        </div>
    </div>

    </div>
    <%--</ContentTemplate></asp:UpdatePanel>--%>
    </form>

    <script>
        function refresh_img() {
            document.getElementById('img_chk').src = 'img_chk.ashx?rnd=' + Math.random();
            document.getElementById('<%=txtCheckCode.ClientID%>').value = '';
            document.getElementById('<%=txtCheckCode.ClientID%>').focus();
        }
    </script>
</asp:Content>
